-
Notifications
You must be signed in to change notification settings - Fork 338
Migrate internal interfaces to pigeon #613
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ened
wants to merge
9
commits into
main
Choose a base branch
from
feature/pigeon-migration
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Move all enum definitions (NetworkType, BackoffPolicy, etc.) to Pigeon for type-safe communication - Replace duplicate Constraints class with Pigeon-generated version while maintaining API compatibility - Remove unused enums.dart and options.dart files - Add centralized Melos task for Pigeon code generation - Configure Pigeon for Kotlin/Swift only (no C++/Objective-C generation) - Fix null safety issues across platform implementations - All packages pass comprehensive dart analyze 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
To view this pull requests documentation preview, visit the following URL: docs.page/fluttercommunity/flutter_workmanager~613 Documentation is deployed and generated using docs.page. |
Hey there and thank you for opening this pull request! 👋🏼 We require pull request titles to follow the Conventional Commits specification and it looks like your proposed title needs to be adjusted. Details:
|
- Replace MethodChannel with type-safe Pigeon WorkmanagerHostApi in WorkmanagerPlugin - Update Pigeon configuration to generate directly in workmanager_android and workmanager_apple packages - Remove manual data extraction and parsing from Extractor.kt and WorkmanagerCallHandler.kt (300+ lines eliminated) - Extract essential WorkManager utilities to WorkManagerUtils.kt for clean separation - Add extension functions to convert Pigeon types to Android WorkManager types - Maintain full API compatibility while gaining type safety - Build and analysis pass successfully Benefits: - Type-safe communication between Dart and Kotlin - Eliminates manual data wrangling and method channel boilerplate - Better error handling and validation - Cleaner separation of concerns - Reduced maintenance burden 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Replace static WM object with WorkManagerWrapper class that takes context as constructor parameter - Create WorkManagerWrapper instance when plugin is attached to engine, destroy when detached - Eliminate context parameter passing throughout all method calls - Improve separation of concerns and lifecycle management - Remove unused helper function - All methods now use clean instance-based API without context wrangling Benefits: - Better lifecycle management with proper cleanup - Cleaner API without context parameter passing - Improved encapsulation and object-oriented design - Thread-safe WorkManager instance management - Reduced boilerplate code 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Remove all "plugin not attached" null checks since Pigeon guarantees host API handlers are not called when plugin is detached - Use non-null assertion (\!\!) for workManagerWrapper since Pigeon manages lifecycle correctly - Simplify all method implementations by removing redundant error handling - Reduce boilerplate code and improve readability Benefits: - Cleaner code without unnecessary defensive programming - Trust Pigeon's lifecycle management guarantees - Reduced complexity and maintenance burden - Better performance without redundant checks 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
…st objects directly - Update WorkManagerWrapper.enqueueOneOffTask and enqueuePeriodicTask to accept Pigeon request objects instead of individual parameters - Remove duplicate extension functions from WorkmanagerPlugin.kt (now in WorkManagerUtils.kt) - Improve context lifecycle management with proper null handling - Add documentation about Pigeon's guarantee that handlers aren't called when plugin is detached - Eliminate 300+ lines of manual parameter extraction code 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Eliminate intermediate BackoffPolicyTaskConfig class that only added complexity - Directly use Pigeon BackoffPolicyConfig values in WorkManager calls - Remove unused kotlin.math.max import - Simplify backoff criteria handling with inline conversion Reduces code complexity while maintaining the same functionality. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Add API level checks for requiresDeviceIdle (API 23+) and TEMPORARILY_UNMETERED (API 30+) - Improve code formatting and readability - Add proper fallback for TEMPORARILY_UNMETERED on older APIs 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Replace SwiftWorkmanagerPlugin with Pigeon-based implementation - Remove unnecessary Objective-C .h/.m files - modern Flutter plugins only need Swift - Implement WorkmanagerHostApi protocol for type-safe communication - Add proper Flutter imports to all Swift files to resolve compilation issues - Remove conflicting NetworkType.swift (replaced by Pigeon-generated types) - Update podspec to remove header file references - Fix class inheritance and method override issues iOS plugin now uses Pigeon end-to-end, matching Android implementation. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Add generic executeIfSupported and executeIfSupportedVoid helper methods - Create createUnsupportedVersionError helper for consistent error handling - Add createBackgroundOperation helper to eliminate duplicate operation setup - Refactor all API methods to use helper functions, reducing code duplication - Simplify network requirements logic in registerProcessingTask - Remove repetitive iOS 13+ availability checks and error creation - Improve code readability while maintaining identical functionality Reduces ~100 lines of repetitive code while improving maintainability. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🤖 Generated with Claude Code